#pragma	once

#include "stdafx.h"
#include "GameMessage.h"

//------------------------------------------------------------------------------------------------------------------------
ChatGameMessage::ChatGameMessage(Z::NetworkId kNetworkId)
:	Z::GameMessage(kNetworkId)
{
}

ChatGameMessage::ChatGameMessage(const std::string& kChat)
:	mChat(kChat)
{
}

void ChatGameMessage::serialize(Z::Streamable& streamable)	const
{
	streamable << id;
	writeString(streamable, mChat);
}

void ChatGameMessage::deserialize(Z::Streamable& streamable)
{
	readString(streamable, mChat, chatSize);
}

//------------------------------------------------------------------------------------------------------------------------
ShoutGameMessage::ShoutGameMessage(Z::NetworkId kNetworkId)
:	Z::GameMessage(kNetworkId)
{
}

ShoutGameMessage::ShoutGameMessage(const std::string& kShout)
:	mShout(kShout)
{
}

void ShoutGameMessage::serialize(Z::Streamable& streamable)	const
{
	streamable << id;
	writeString(streamable, mShout);
}

void ShoutGameMessage::deserialize(Z::Streamable& streamable)
{
	readString(streamable, mShout, shoutSize);
}